<template>
  <div class="data-card">
    <div class="card-icon">
      <img :src="iconSrc" :alt="label" class="icon-svg" />
    </div>
    <div class="card-info">
      <p class="card-label">{{ label }}</p>
      <p class="card-value">{{ value }}</p>
    </div>
  </div>
</template>

<script setup>
import { defineProps } from 'vue';

// 接收参数：图标类名、图标样式、标签文本、数值
const props = defineProps({
 iconSrc: {
    type: String,
    required: true
  },
  label: {
    type: String,
    required: true
  },
  value: {
    type: String,
    required: true
  }
});
</script>

<style scoped>
.data-card {
  background-color: white; /* 深色背景 */
  border-radius: 12px;
  padding: 20px;
  color: #0b0b0b;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 80px;
}

.data-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 15px -3px rgba(0, 0, 0, 0.2);
}

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.card-icon i {
  font-size: 24px;
  color: white;
}

.card-info {
  margin-left: 20px;
  flex: 1;
  min-width: 0;
}

.card-info .card-label {
  margin: 0 0 6px 0;
  font-size: 14px;
  color: #94a3b8; /* 浅色标签 */
  font-weight: 500;
}

.card-info .card-value {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .data-card {
    padding: 16px;
    gap: 12px;
    min-height: 70px;
  }
  
  .card-icon {
    width: 40px;
    height: 40px;
  }
  
  .card-icon i {
    font-size: 20px;
  }
  
  .card-info .card-value {
    font-size: 20px;
  }
}
</style>